
_1:     file format elf32-i386


Disassembly of section .text:

00000000 <main>:
#include "types.h"
#include "stat.h"
#include "user.h"

int main(){
   0:	55                   	push   %ebp
   1:	89 e5                	mov    %esp,%ebp
   3:	83 e4 f0             	and    $0xfffffff0,%esp
   6:	83 ec 20             	sub    $0x20,%esp
  int *x;
  int i;
  for(i=0; i<10000; i++){
   9:	c7 44 24 1c 00 00 00 	movl   $0x0,0x1c(%esp)
  10:	00 
  11:	eb 31                	jmp    44 <main+0x44>
    x = malloc(sizeof(int));
  13:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  1a:	e8 fc 06 00 00       	call   71b <malloc>
  1f:	89 44 24 18          	mov    %eax,0x18(%esp)
    printf(1, "got address: %x\n", x);
  23:	8b 44 24 18          	mov    0x18(%esp),%eax
  27:	89 44 24 08          	mov    %eax,0x8(%esp)
  2b:	c7 44 24 04 fb 07 00 	movl   $0x7fb,0x4(%esp)
  32:	00 
  33:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  3a:	e8 f4 03 00 00       	call   433 <printf>
#include "user.h"

int main(){
  int *x;
  int i;
  for(i=0; i<10000; i++){
  3f:	83 44 24 1c 01       	addl   $0x1,0x1c(%esp)
  44:	81 7c 24 1c 0f 27 00 	cmpl   $0x270f,0x1c(%esp)
  4b:	00 
  4c:	7e c5                	jle    13 <main+0x13>
    x = malloc(sizeof(int));
    printf(1, "got address: %x\n", x);
  }
  return 0;
  4e:	b8 00 00 00 00       	mov    $0x0,%eax
  53:	c9                   	leave  
  54:	c3                   	ret    
  55:	90                   	nop
  56:	90                   	nop
  57:	90                   	nop

00000058 <stosb>:
               "cc");
}

static inline void
stosb(void *addr, int data, int cnt)
{
  58:	55                   	push   %ebp
  59:	89 e5                	mov    %esp,%ebp
  5b:	57                   	push   %edi
  5c:	53                   	push   %ebx
  asm volatile("cld; rep stosb" :
  5d:	8b 4d 08             	mov    0x8(%ebp),%ecx
  60:	8b 55 10             	mov    0x10(%ebp),%edx
  63:	8b 45 0c             	mov    0xc(%ebp),%eax
  66:	89 cb                	mov    %ecx,%ebx
  68:	89 df                	mov    %ebx,%edi
  6a:	89 d1                	mov    %edx,%ecx
  6c:	fc                   	cld    
  6d:	f3 aa                	rep stos %al,%es:(%edi)
  6f:	89 ca                	mov    %ecx,%edx
  71:	89 fb                	mov    %edi,%ebx
  73:	89 5d 08             	mov    %ebx,0x8(%ebp)
  76:	89 55 10             	mov    %edx,0x10(%ebp)
               "=D" (addr), "=c" (cnt) :
               "0" (addr), "1" (cnt), "a" (data) :
               "memory", "cc");
}
  79:	5b                   	pop    %ebx
  7a:	5f                   	pop    %edi
  7b:	5d                   	pop    %ebp
  7c:	c3                   	ret    

0000007d <strcpy>:
#include "user.h"
#include "x86.h"

char*
strcpy(char *s, char *t)
{
  7d:	55                   	push   %ebp
  7e:	89 e5                	mov    %esp,%ebp
  80:	83 ec 10             	sub    $0x10,%esp
  char *os;

  os = s;
  83:	8b 45 08             	mov    0x8(%ebp),%eax
  86:	89 45 fc             	mov    %eax,-0x4(%ebp)
  while((*s++ = *t++) != 0)
  89:	90                   	nop
  8a:	8b 45 0c             	mov    0xc(%ebp),%eax
  8d:	0f b6 10             	movzbl (%eax),%edx
  90:	8b 45 08             	mov    0x8(%ebp),%eax
  93:	88 10                	mov    %dl,(%eax)
  95:	8b 45 08             	mov    0x8(%ebp),%eax
  98:	0f b6 00             	movzbl (%eax),%eax
  9b:	84 c0                	test   %al,%al
  9d:	0f 95 c0             	setne  %al
  a0:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  a4:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
  a8:	84 c0                	test   %al,%al
  aa:	75 de                	jne    8a <strcpy+0xd>
    ;
  return os;
  ac:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  af:	c9                   	leave  
  b0:	c3                   	ret    

000000b1 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  b1:	55                   	push   %ebp
  b2:	89 e5                	mov    %esp,%ebp
  while(*p && *p == *q)
  b4:	eb 08                	jmp    be <strcmp+0xd>
    p++, q++;
  b6:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  ba:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
}

int
strcmp(const char *p, const char *q)
{
  while(*p && *p == *q)
  be:	8b 45 08             	mov    0x8(%ebp),%eax
  c1:	0f b6 00             	movzbl (%eax),%eax
  c4:	84 c0                	test   %al,%al
  c6:	74 10                	je     d8 <strcmp+0x27>
  c8:	8b 45 08             	mov    0x8(%ebp),%eax
  cb:	0f b6 10             	movzbl (%eax),%edx
  ce:	8b 45 0c             	mov    0xc(%ebp),%eax
  d1:	0f b6 00             	movzbl (%eax),%eax
  d4:	38 c2                	cmp    %al,%dl
  d6:	74 de                	je     b6 <strcmp+0x5>
    p++, q++;
  return (uchar)*p - (uchar)*q;
  d8:	8b 45 08             	mov    0x8(%ebp),%eax
  db:	0f b6 00             	movzbl (%eax),%eax
  de:	0f b6 d0             	movzbl %al,%edx
  e1:	8b 45 0c             	mov    0xc(%ebp),%eax
  e4:	0f b6 00             	movzbl (%eax),%eax
  e7:	0f b6 c0             	movzbl %al,%eax
  ea:	89 d1                	mov    %edx,%ecx
  ec:	29 c1                	sub    %eax,%ecx
  ee:	89 c8                	mov    %ecx,%eax
}
  f0:	5d                   	pop    %ebp
  f1:	c3                   	ret    

000000f2 <strlen>:

uint
strlen(char *s)
{
  f2:	55                   	push   %ebp
  f3:	89 e5                	mov    %esp,%ebp
  f5:	83 ec 10             	sub    $0x10,%esp
  int n;

  for(n = 0; s[n]; n++)
  f8:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  ff:	eb 04                	jmp    105 <strlen+0x13>
 101:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 105:	8b 45 fc             	mov    -0x4(%ebp),%eax
 108:	03 45 08             	add    0x8(%ebp),%eax
 10b:	0f b6 00             	movzbl (%eax),%eax
 10e:	84 c0                	test   %al,%al
 110:	75 ef                	jne    101 <strlen+0xf>
    ;
  return n;
 112:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 115:	c9                   	leave  
 116:	c3                   	ret    

00000117 <memset>:

void*
memset(void *dst, int c, uint n)
{
 117:	55                   	push   %ebp
 118:	89 e5                	mov    %esp,%ebp
 11a:	83 ec 0c             	sub    $0xc,%esp
  stosb(dst, c, n);
 11d:	8b 45 10             	mov    0x10(%ebp),%eax
 120:	89 44 24 08          	mov    %eax,0x8(%esp)
 124:	8b 45 0c             	mov    0xc(%ebp),%eax
 127:	89 44 24 04          	mov    %eax,0x4(%esp)
 12b:	8b 45 08             	mov    0x8(%ebp),%eax
 12e:	89 04 24             	mov    %eax,(%esp)
 131:	e8 22 ff ff ff       	call   58 <stosb>
  return dst;
 136:	8b 45 08             	mov    0x8(%ebp),%eax
}
 139:	c9                   	leave  
 13a:	c3                   	ret    

0000013b <strchr>:

char*
strchr(const char *s, char c)
{
 13b:	55                   	push   %ebp
 13c:	89 e5                	mov    %esp,%ebp
 13e:	83 ec 04             	sub    $0x4,%esp
 141:	8b 45 0c             	mov    0xc(%ebp),%eax
 144:	88 45 fc             	mov    %al,-0x4(%ebp)
  for(; *s; s++)
 147:	eb 14                	jmp    15d <strchr+0x22>
    if(*s == c)
 149:	8b 45 08             	mov    0x8(%ebp),%eax
 14c:	0f b6 00             	movzbl (%eax),%eax
 14f:	3a 45 fc             	cmp    -0x4(%ebp),%al
 152:	75 05                	jne    159 <strchr+0x1e>
      return (char*)s;
 154:	8b 45 08             	mov    0x8(%ebp),%eax
 157:	eb 13                	jmp    16c <strchr+0x31>
}

char*
strchr(const char *s, char c)
{
  for(; *s; s++)
 159:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 15d:	8b 45 08             	mov    0x8(%ebp),%eax
 160:	0f b6 00             	movzbl (%eax),%eax
 163:	84 c0                	test   %al,%al
 165:	75 e2                	jne    149 <strchr+0xe>
    if(*s == c)
      return (char*)s;
  return 0;
 167:	b8 00 00 00 00       	mov    $0x0,%eax
}
 16c:	c9                   	leave  
 16d:	c3                   	ret    

0000016e <gets>:

char*
gets(char *buf, int max)
{
 16e:	55                   	push   %ebp
 16f:	89 e5                	mov    %esp,%ebp
 171:	83 ec 28             	sub    $0x28,%esp
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 174:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
 17b:	eb 44                	jmp    1c1 <gets+0x53>
    cc = read(0, &c, 1);
 17d:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
 184:	00 
 185:	8d 45 ef             	lea    -0x11(%ebp),%eax
 188:	89 44 24 04          	mov    %eax,0x4(%esp)
 18c:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 193:	e8 3c 01 00 00       	call   2d4 <read>
 198:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if(cc < 1)
 19b:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 19f:	7e 2d                	jle    1ce <gets+0x60>
      break;
    buf[i++] = c;
 1a1:	8b 45 f4             	mov    -0xc(%ebp),%eax
 1a4:	03 45 08             	add    0x8(%ebp),%eax
 1a7:	0f b6 55 ef          	movzbl -0x11(%ebp),%edx
 1ab:	88 10                	mov    %dl,(%eax)
 1ad:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
    if(c == '\n' || c == '\r')
 1b1:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 1b5:	3c 0a                	cmp    $0xa,%al
 1b7:	74 16                	je     1cf <gets+0x61>
 1b9:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 1bd:	3c 0d                	cmp    $0xd,%al
 1bf:	74 0e                	je     1cf <gets+0x61>
gets(char *buf, int max)
{
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 1c1:	8b 45 f4             	mov    -0xc(%ebp),%eax
 1c4:	83 c0 01             	add    $0x1,%eax
 1c7:	3b 45 0c             	cmp    0xc(%ebp),%eax
 1ca:	7c b1                	jl     17d <gets+0xf>
 1cc:	eb 01                	jmp    1cf <gets+0x61>
    cc = read(0, &c, 1);
    if(cc < 1)
      break;
 1ce:	90                   	nop
    buf[i++] = c;
    if(c == '\n' || c == '\r')
      break;
  }
  buf[i] = '\0';
 1cf:	8b 45 f4             	mov    -0xc(%ebp),%eax
 1d2:	03 45 08             	add    0x8(%ebp),%eax
 1d5:	c6 00 00             	movb   $0x0,(%eax)
  return buf;
 1d8:	8b 45 08             	mov    0x8(%ebp),%eax
}
 1db:	c9                   	leave  
 1dc:	c3                   	ret    

000001dd <stat>:

int
stat(char *n, struct stat *st)
{
 1dd:	55                   	push   %ebp
 1de:	89 e5                	mov    %esp,%ebp
 1e0:	83 ec 28             	sub    $0x28,%esp
  int fd;
  int r;

  fd = open(n, O_RDONLY);
 1e3:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
 1ea:	00 
 1eb:	8b 45 08             	mov    0x8(%ebp),%eax
 1ee:	89 04 24             	mov    %eax,(%esp)
 1f1:	e8 06 01 00 00       	call   2fc <open>
 1f6:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(fd < 0)
 1f9:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 1fd:	79 07                	jns    206 <stat+0x29>
    return -1;
 1ff:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
 204:	eb 23                	jmp    229 <stat+0x4c>
  r = fstat(fd, st);
 206:	8b 45 0c             	mov    0xc(%ebp),%eax
 209:	89 44 24 04          	mov    %eax,0x4(%esp)
 20d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 210:	89 04 24             	mov    %eax,(%esp)
 213:	e8 fc 00 00 00       	call   314 <fstat>
 218:	89 45 f0             	mov    %eax,-0x10(%ebp)
  close(fd);
 21b:	8b 45 f4             	mov    -0xc(%ebp),%eax
 21e:	89 04 24             	mov    %eax,(%esp)
 221:	e8 be 00 00 00       	call   2e4 <close>
  return r;
 226:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
 229:	c9                   	leave  
 22a:	c3                   	ret    

0000022b <atoi>:

int
atoi(const char *s)
{
 22b:	55                   	push   %ebp
 22c:	89 e5                	mov    %esp,%ebp
 22e:	83 ec 10             	sub    $0x10,%esp
  int n;

  n = 0;
 231:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  while('0' <= *s && *s <= '9')
 238:	eb 24                	jmp    25e <atoi+0x33>
    n = n*10 + *s++ - '0';
 23a:	8b 55 fc             	mov    -0x4(%ebp),%edx
 23d:	89 d0                	mov    %edx,%eax
 23f:	c1 e0 02             	shl    $0x2,%eax
 242:	01 d0                	add    %edx,%eax
 244:	01 c0                	add    %eax,%eax
 246:	89 c2                	mov    %eax,%edx
 248:	8b 45 08             	mov    0x8(%ebp),%eax
 24b:	0f b6 00             	movzbl (%eax),%eax
 24e:	0f be c0             	movsbl %al,%eax
 251:	8d 04 02             	lea    (%edx,%eax,1),%eax
 254:	83 e8 30             	sub    $0x30,%eax
 257:	89 45 fc             	mov    %eax,-0x4(%ebp)
 25a:	83 45 08 01          	addl   $0x1,0x8(%ebp)
atoi(const char *s)
{
  int n;

  n = 0;
  while('0' <= *s && *s <= '9')
 25e:	8b 45 08             	mov    0x8(%ebp),%eax
 261:	0f b6 00             	movzbl (%eax),%eax
 264:	3c 2f                	cmp    $0x2f,%al
 266:	7e 0a                	jle    272 <atoi+0x47>
 268:	8b 45 08             	mov    0x8(%ebp),%eax
 26b:	0f b6 00             	movzbl (%eax),%eax
 26e:	3c 39                	cmp    $0x39,%al
 270:	7e c8                	jle    23a <atoi+0xf>
    n = n*10 + *s++ - '0';
  return n;
 272:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 275:	c9                   	leave  
 276:	c3                   	ret    

00000277 <memmove>:

void*
memmove(void *vdst, void *vsrc, int n)
{
 277:	55                   	push   %ebp
 278:	89 e5                	mov    %esp,%ebp
 27a:	83 ec 10             	sub    $0x10,%esp
  char *dst, *src;
  
  dst = vdst;
 27d:	8b 45 08             	mov    0x8(%ebp),%eax
 280:	89 45 fc             	mov    %eax,-0x4(%ebp)
  src = vsrc;
 283:	8b 45 0c             	mov    0xc(%ebp),%eax
 286:	89 45 f8             	mov    %eax,-0x8(%ebp)
  while(n-- > 0)
 289:	eb 13                	jmp    29e <memmove+0x27>
    *dst++ = *src++;
 28b:	8b 45 f8             	mov    -0x8(%ebp),%eax
 28e:	0f b6 10             	movzbl (%eax),%edx
 291:	8b 45 fc             	mov    -0x4(%ebp),%eax
 294:	88 10                	mov    %dl,(%eax)
 296:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 29a:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
{
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
 29e:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
 2a2:	0f 9f c0             	setg   %al
 2a5:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
 2a9:	84 c0                	test   %al,%al
 2ab:	75 de                	jne    28b <memmove+0x14>
    *dst++ = *src++;
  return vdst;
 2ad:	8b 45 08             	mov    0x8(%ebp),%eax
}
 2b0:	c9                   	leave  
 2b1:	c3                   	ret    
 2b2:	90                   	nop
 2b3:	90                   	nop

000002b4 <fork>:
  name: \
    movl $SYS_ ## name, %eax; \
    int $T_SYSCALL; \
    ret

SYSCALL(fork)
 2b4:	b8 01 00 00 00       	mov    $0x1,%eax
 2b9:	cd 40                	int    $0x40
 2bb:	c3                   	ret    

000002bc <exit>:
SYSCALL(exit)
 2bc:	b8 02 00 00 00       	mov    $0x2,%eax
 2c1:	cd 40                	int    $0x40
 2c3:	c3                   	ret    

000002c4 <wait>:
SYSCALL(wait)
 2c4:	b8 03 00 00 00       	mov    $0x3,%eax
 2c9:	cd 40                	int    $0x40
 2cb:	c3                   	ret    

000002cc <pipe>:
SYSCALL(pipe)
 2cc:	b8 04 00 00 00       	mov    $0x4,%eax
 2d1:	cd 40                	int    $0x40
 2d3:	c3                   	ret    

000002d4 <read>:
SYSCALL(read)
 2d4:	b8 05 00 00 00       	mov    $0x5,%eax
 2d9:	cd 40                	int    $0x40
 2db:	c3                   	ret    

000002dc <write>:
SYSCALL(write)
 2dc:	b8 10 00 00 00       	mov    $0x10,%eax
 2e1:	cd 40                	int    $0x40
 2e3:	c3                   	ret    

000002e4 <close>:
SYSCALL(close)
 2e4:	b8 15 00 00 00       	mov    $0x15,%eax
 2e9:	cd 40                	int    $0x40
 2eb:	c3                   	ret    

000002ec <kill>:
SYSCALL(kill)
 2ec:	b8 06 00 00 00       	mov    $0x6,%eax
 2f1:	cd 40                	int    $0x40
 2f3:	c3                   	ret    

000002f4 <exec>:
SYSCALL(exec)
 2f4:	b8 07 00 00 00       	mov    $0x7,%eax
 2f9:	cd 40                	int    $0x40
 2fb:	c3                   	ret    

000002fc <open>:
SYSCALL(open)
 2fc:	b8 0f 00 00 00       	mov    $0xf,%eax
 301:	cd 40                	int    $0x40
 303:	c3                   	ret    

00000304 <mknod>:
SYSCALL(mknod)
 304:	b8 11 00 00 00       	mov    $0x11,%eax
 309:	cd 40                	int    $0x40
 30b:	c3                   	ret    

0000030c <unlink>:
SYSCALL(unlink)
 30c:	b8 12 00 00 00       	mov    $0x12,%eax
 311:	cd 40                	int    $0x40
 313:	c3                   	ret    

00000314 <fstat>:
SYSCALL(fstat)
 314:	b8 08 00 00 00       	mov    $0x8,%eax
 319:	cd 40                	int    $0x40
 31b:	c3                   	ret    

0000031c <link>:
SYSCALL(link)
 31c:	b8 13 00 00 00       	mov    $0x13,%eax
 321:	cd 40                	int    $0x40
 323:	c3                   	ret    

00000324 <mkdir>:
SYSCALL(mkdir)
 324:	b8 14 00 00 00       	mov    $0x14,%eax
 329:	cd 40                	int    $0x40
 32b:	c3                   	ret    

0000032c <chdir>:
SYSCALL(chdir)
 32c:	b8 09 00 00 00       	mov    $0x9,%eax
 331:	cd 40                	int    $0x40
 333:	c3                   	ret    

00000334 <dup>:
SYSCALL(dup)
 334:	b8 0a 00 00 00       	mov    $0xa,%eax
 339:	cd 40                	int    $0x40
 33b:	c3                   	ret    

0000033c <getpid>:
SYSCALL(getpid)
 33c:	b8 0b 00 00 00       	mov    $0xb,%eax
 341:	cd 40                	int    $0x40
 343:	c3                   	ret    

00000344 <sbrk>:
SYSCALL(sbrk)
 344:	b8 0c 00 00 00       	mov    $0xc,%eax
 349:	cd 40                	int    $0x40
 34b:	c3                   	ret    

0000034c <sleep>:
SYSCALL(sleep)
 34c:	b8 0d 00 00 00       	mov    $0xd,%eax
 351:	cd 40                	int    $0x40
 353:	c3                   	ret    

00000354 <uptime>:
SYSCALL(uptime)
 354:	b8 0e 00 00 00       	mov    $0xe,%eax
 359:	cd 40                	int    $0x40
 35b:	c3                   	ret    

0000035c <putc>:
#include "stat.h"
#include "user.h"

static void
putc(int fd, char c)
{
 35c:	55                   	push   %ebp
 35d:	89 e5                	mov    %esp,%ebp
 35f:	83 ec 28             	sub    $0x28,%esp
 362:	8b 45 0c             	mov    0xc(%ebp),%eax
 365:	88 45 f4             	mov    %al,-0xc(%ebp)
  write(fd, &c, 1);
 368:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
 36f:	00 
 370:	8d 45 f4             	lea    -0xc(%ebp),%eax
 373:	89 44 24 04          	mov    %eax,0x4(%esp)
 377:	8b 45 08             	mov    0x8(%ebp),%eax
 37a:	89 04 24             	mov    %eax,(%esp)
 37d:	e8 5a ff ff ff       	call   2dc <write>
}
 382:	c9                   	leave  
 383:	c3                   	ret    

00000384 <printint>:

static void
printint(int fd, int xx, int base, int sgn)
{
 384:	55                   	push   %ebp
 385:	89 e5                	mov    %esp,%ebp
 387:	83 ec 48             	sub    $0x48,%esp
  static char digits[] = "0123456789ABCDEF";
  char buf[16];
  int i, neg;
  uint x;

  neg = 0;
 38a:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  if(sgn && xx < 0){
 391:	83 7d 14 00          	cmpl   $0x0,0x14(%ebp)
 395:	74 17                	je     3ae <printint+0x2a>
 397:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
 39b:	79 11                	jns    3ae <printint+0x2a>
    neg = 1;
 39d:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
    x = -xx;
 3a4:	8b 45 0c             	mov    0xc(%ebp),%eax
 3a7:	f7 d8                	neg    %eax
 3a9:	89 45 ec             	mov    %eax,-0x14(%ebp)
 3ac:	eb 06                	jmp    3b4 <printint+0x30>
  } else {
    x = xx;
 3ae:	8b 45 0c             	mov    0xc(%ebp),%eax
 3b1:	89 45 ec             	mov    %eax,-0x14(%ebp)
  }

  i = 0;
 3b4:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  do{
    buf[i++] = digits[x % base];
 3bb:	8b 4d 10             	mov    0x10(%ebp),%ecx
 3be:	8b 45 ec             	mov    -0x14(%ebp),%eax
 3c1:	ba 00 00 00 00       	mov    $0x0,%edx
 3c6:	f7 f1                	div    %ecx
 3c8:	89 d0                	mov    %edx,%eax
 3ca:	0f b6 90 14 08 00 00 	movzbl 0x814(%eax),%edx
 3d1:	8d 45 dc             	lea    -0x24(%ebp),%eax
 3d4:	03 45 f4             	add    -0xc(%ebp),%eax
 3d7:	88 10                	mov    %dl,(%eax)
 3d9:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  }while((x /= base) != 0);
 3dd:	8b 45 10             	mov    0x10(%ebp),%eax
 3e0:	89 45 d4             	mov    %eax,-0x2c(%ebp)
 3e3:	8b 45 ec             	mov    -0x14(%ebp),%eax
 3e6:	ba 00 00 00 00       	mov    $0x0,%edx
 3eb:	f7 75 d4             	divl   -0x2c(%ebp)
 3ee:	89 45 ec             	mov    %eax,-0x14(%ebp)
 3f1:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 3f5:	75 c4                	jne    3bb <printint+0x37>
  if(neg)
 3f7:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 3fb:	74 2a                	je     427 <printint+0xa3>
    buf[i++] = '-';
 3fd:	8d 45 dc             	lea    -0x24(%ebp),%eax
 400:	03 45 f4             	add    -0xc(%ebp),%eax
 403:	c6 00 2d             	movb   $0x2d,(%eax)
 406:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)

  while(--i >= 0)
 40a:	eb 1b                	jmp    427 <printint+0xa3>
    putc(fd, buf[i]);
 40c:	8d 45 dc             	lea    -0x24(%ebp),%eax
 40f:	03 45 f4             	add    -0xc(%ebp),%eax
 412:	0f b6 00             	movzbl (%eax),%eax
 415:	0f be c0             	movsbl %al,%eax
 418:	89 44 24 04          	mov    %eax,0x4(%esp)
 41c:	8b 45 08             	mov    0x8(%ebp),%eax
 41f:	89 04 24             	mov    %eax,(%esp)
 422:	e8 35 ff ff ff       	call   35c <putc>
    buf[i++] = digits[x % base];
  }while((x /= base) != 0);
  if(neg)
    buf[i++] = '-';

  while(--i >= 0)
 427:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
 42b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 42f:	79 db                	jns    40c <printint+0x88>
    putc(fd, buf[i]);
}
 431:	c9                   	leave  
 432:	c3                   	ret    

00000433 <printf>:

// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
 433:	55                   	push   %ebp
 434:	89 e5                	mov    %esp,%ebp
 436:	83 ec 38             	sub    $0x38,%esp
  char *s;
  int c, i, state;
  uint *ap;

  state = 0;
 439:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  ap = (uint*)(void*)&fmt + 1;
 440:	8d 45 0c             	lea    0xc(%ebp),%eax
 443:	83 c0 04             	add    $0x4,%eax
 446:	89 45 e8             	mov    %eax,-0x18(%ebp)
  for(i = 0; fmt[i]; i++){
 449:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
 450:	e9 7e 01 00 00       	jmp    5d3 <printf+0x1a0>
    c = fmt[i] & 0xff;
 455:	8b 55 0c             	mov    0xc(%ebp),%edx
 458:	8b 45 f0             	mov    -0x10(%ebp),%eax
 45b:	8d 04 02             	lea    (%edx,%eax,1),%eax
 45e:	0f b6 00             	movzbl (%eax),%eax
 461:	0f be c0             	movsbl %al,%eax
 464:	25 ff 00 00 00       	and    $0xff,%eax
 469:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if(state == 0){
 46c:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 470:	75 2c                	jne    49e <printf+0x6b>
      if(c == '%'){
 472:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 476:	75 0c                	jne    484 <printf+0x51>
        state = '%';
 478:	c7 45 ec 25 00 00 00 	movl   $0x25,-0x14(%ebp)
 47f:	e9 4b 01 00 00       	jmp    5cf <printf+0x19c>
      } else {
        putc(fd, c);
 484:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 487:	0f be c0             	movsbl %al,%eax
 48a:	89 44 24 04          	mov    %eax,0x4(%esp)
 48e:	8b 45 08             	mov    0x8(%ebp),%eax
 491:	89 04 24             	mov    %eax,(%esp)
 494:	e8 c3 fe ff ff       	call   35c <putc>
 499:	e9 31 01 00 00       	jmp    5cf <printf+0x19c>
      }
    } else if(state == '%'){
 49e:	83 7d ec 25          	cmpl   $0x25,-0x14(%ebp)
 4a2:	0f 85 27 01 00 00    	jne    5cf <printf+0x19c>
      if(c == 'd'){
 4a8:	83 7d e4 64          	cmpl   $0x64,-0x1c(%ebp)
 4ac:	75 2d                	jne    4db <printf+0xa8>
        printint(fd, *ap, 10, 1);
 4ae:	8b 45 e8             	mov    -0x18(%ebp),%eax
 4b1:	8b 00                	mov    (%eax),%eax
 4b3:	c7 44 24 0c 01 00 00 	movl   $0x1,0xc(%esp)
 4ba:	00 
 4bb:	c7 44 24 08 0a 00 00 	movl   $0xa,0x8(%esp)
 4c2:	00 
 4c3:	89 44 24 04          	mov    %eax,0x4(%esp)
 4c7:	8b 45 08             	mov    0x8(%ebp),%eax
 4ca:	89 04 24             	mov    %eax,(%esp)
 4cd:	e8 b2 fe ff ff       	call   384 <printint>
        ap++;
 4d2:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 4d6:	e9 ed 00 00 00       	jmp    5c8 <printf+0x195>
      } else if(c == 'x' || c == 'p'){
 4db:	83 7d e4 78          	cmpl   $0x78,-0x1c(%ebp)
 4df:	74 06                	je     4e7 <printf+0xb4>
 4e1:	83 7d e4 70          	cmpl   $0x70,-0x1c(%ebp)
 4e5:	75 2d                	jne    514 <printf+0xe1>
        printint(fd, *ap, 16, 0);
 4e7:	8b 45 e8             	mov    -0x18(%ebp),%eax
 4ea:	8b 00                	mov    (%eax),%eax
 4ec:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
 4f3:	00 
 4f4:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
 4fb:	00 
 4fc:	89 44 24 04          	mov    %eax,0x4(%esp)
 500:	8b 45 08             	mov    0x8(%ebp),%eax
 503:	89 04 24             	mov    %eax,(%esp)
 506:	e8 79 fe ff ff       	call   384 <printint>
        ap++;
 50b:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 50f:	e9 b4 00 00 00       	jmp    5c8 <printf+0x195>
      } else if(c == 's'){
 514:	83 7d e4 73          	cmpl   $0x73,-0x1c(%ebp)
 518:	75 46                	jne    560 <printf+0x12d>
        s = (char*)*ap;
 51a:	8b 45 e8             	mov    -0x18(%ebp),%eax
 51d:	8b 00                	mov    (%eax),%eax
 51f:	89 45 f4             	mov    %eax,-0xc(%ebp)
        ap++;
 522:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
        if(s == 0)
 526:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 52a:	75 27                	jne    553 <printf+0x120>
          s = "(null)";
 52c:	c7 45 f4 0c 08 00 00 	movl   $0x80c,-0xc(%ebp)
        while(*s != 0){
 533:	eb 1f                	jmp    554 <printf+0x121>
          putc(fd, *s);
 535:	8b 45 f4             	mov    -0xc(%ebp),%eax
 538:	0f b6 00             	movzbl (%eax),%eax
 53b:	0f be c0             	movsbl %al,%eax
 53e:	89 44 24 04          	mov    %eax,0x4(%esp)
 542:	8b 45 08             	mov    0x8(%ebp),%eax
 545:	89 04 24             	mov    %eax,(%esp)
 548:	e8 0f fe ff ff       	call   35c <putc>
          s++;
 54d:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
 551:	eb 01                	jmp    554 <printf+0x121>
      } else if(c == 's'){
        s = (char*)*ap;
        ap++;
        if(s == 0)
          s = "(null)";
        while(*s != 0){
 553:	90                   	nop
 554:	8b 45 f4             	mov    -0xc(%ebp),%eax
 557:	0f b6 00             	movzbl (%eax),%eax
 55a:	84 c0                	test   %al,%al
 55c:	75 d7                	jne    535 <printf+0x102>
 55e:	eb 68                	jmp    5c8 <printf+0x195>
          putc(fd, *s);
          s++;
        }
      } else if(c == 'c'){
 560:	83 7d e4 63          	cmpl   $0x63,-0x1c(%ebp)
 564:	75 1d                	jne    583 <printf+0x150>
        putc(fd, *ap);
 566:	8b 45 e8             	mov    -0x18(%ebp),%eax
 569:	8b 00                	mov    (%eax),%eax
 56b:	0f be c0             	movsbl %al,%eax
 56e:	89 44 24 04          	mov    %eax,0x4(%esp)
 572:	8b 45 08             	mov    0x8(%ebp),%eax
 575:	89 04 24             	mov    %eax,(%esp)
 578:	e8 df fd ff ff       	call   35c <putc>
        ap++;
 57d:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 581:	eb 45                	jmp    5c8 <printf+0x195>
      } else if(c == '%'){
 583:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 587:	75 17                	jne    5a0 <printf+0x16d>
        putc(fd, c);
 589:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 58c:	0f be c0             	movsbl %al,%eax
 58f:	89 44 24 04          	mov    %eax,0x4(%esp)
 593:	8b 45 08             	mov    0x8(%ebp),%eax
 596:	89 04 24             	mov    %eax,(%esp)
 599:	e8 be fd ff ff       	call   35c <putc>
 59e:	eb 28                	jmp    5c8 <printf+0x195>
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
 5a0:	c7 44 24 04 25 00 00 	movl   $0x25,0x4(%esp)
 5a7:	00 
 5a8:	8b 45 08             	mov    0x8(%ebp),%eax
 5ab:	89 04 24             	mov    %eax,(%esp)
 5ae:	e8 a9 fd ff ff       	call   35c <putc>
        putc(fd, c);
 5b3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 5b6:	0f be c0             	movsbl %al,%eax
 5b9:	89 44 24 04          	mov    %eax,0x4(%esp)
 5bd:	8b 45 08             	mov    0x8(%ebp),%eax
 5c0:	89 04 24             	mov    %eax,(%esp)
 5c3:	e8 94 fd ff ff       	call   35c <putc>
      }
      state = 0;
 5c8:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  int c, i, state;
  uint *ap;

  state = 0;
  ap = (uint*)(void*)&fmt + 1;
  for(i = 0; fmt[i]; i++){
 5cf:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
 5d3:	8b 55 0c             	mov    0xc(%ebp),%edx
 5d6:	8b 45 f0             	mov    -0x10(%ebp),%eax
 5d9:	8d 04 02             	lea    (%edx,%eax,1),%eax
 5dc:	0f b6 00             	movzbl (%eax),%eax
 5df:	84 c0                	test   %al,%al
 5e1:	0f 85 6e fe ff ff    	jne    455 <printf+0x22>
        putc(fd, c);
      }
      state = 0;
    }
  }
}
 5e7:	c9                   	leave  
 5e8:	c3                   	ret    
 5e9:	90                   	nop
 5ea:	90                   	nop
 5eb:	90                   	nop

000005ec <free>:
static Header base;
static Header *freep;

void
free(void *ap)
{
 5ec:	55                   	push   %ebp
 5ed:	89 e5                	mov    %esp,%ebp
 5ef:	83 ec 10             	sub    $0x10,%esp
  Header *bp, *p;

  bp = (Header*)ap - 1;
 5f2:	8b 45 08             	mov    0x8(%ebp),%eax
 5f5:	83 e8 08             	sub    $0x8,%eax
 5f8:	89 45 f8             	mov    %eax,-0x8(%ebp)
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 5fb:	a1 30 08 00 00       	mov    0x830,%eax
 600:	89 45 fc             	mov    %eax,-0x4(%ebp)
 603:	eb 24                	jmp    629 <free+0x3d>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
 605:	8b 45 fc             	mov    -0x4(%ebp),%eax
 608:	8b 00                	mov    (%eax),%eax
 60a:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 60d:	77 12                	ja     621 <free+0x35>
 60f:	8b 45 f8             	mov    -0x8(%ebp),%eax
 612:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 615:	77 24                	ja     63b <free+0x4f>
 617:	8b 45 fc             	mov    -0x4(%ebp),%eax
 61a:	8b 00                	mov    (%eax),%eax
 61c:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 61f:	77 1a                	ja     63b <free+0x4f>
free(void *ap)
{
  Header *bp, *p;

  bp = (Header*)ap - 1;
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 621:	8b 45 fc             	mov    -0x4(%ebp),%eax
 624:	8b 00                	mov    (%eax),%eax
 626:	89 45 fc             	mov    %eax,-0x4(%ebp)
 629:	8b 45 f8             	mov    -0x8(%ebp),%eax
 62c:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 62f:	76 d4                	jbe    605 <free+0x19>
 631:	8b 45 fc             	mov    -0x4(%ebp),%eax
 634:	8b 00                	mov    (%eax),%eax
 636:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 639:	76 ca                	jbe    605 <free+0x19>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
      break;
  if(bp + bp->s.size == p->s.ptr){
 63b:	8b 45 f8             	mov    -0x8(%ebp),%eax
 63e:	8b 40 04             	mov    0x4(%eax),%eax
 641:	c1 e0 03             	shl    $0x3,%eax
 644:	89 c2                	mov    %eax,%edx
 646:	03 55 f8             	add    -0x8(%ebp),%edx
 649:	8b 45 fc             	mov    -0x4(%ebp),%eax
 64c:	8b 00                	mov    (%eax),%eax
 64e:	39 c2                	cmp    %eax,%edx
 650:	75 24                	jne    676 <free+0x8a>
    bp->s.size += p->s.ptr->s.size;
 652:	8b 45 f8             	mov    -0x8(%ebp),%eax
 655:	8b 50 04             	mov    0x4(%eax),%edx
 658:	8b 45 fc             	mov    -0x4(%ebp),%eax
 65b:	8b 00                	mov    (%eax),%eax
 65d:	8b 40 04             	mov    0x4(%eax),%eax
 660:	01 c2                	add    %eax,%edx
 662:	8b 45 f8             	mov    -0x8(%ebp),%eax
 665:	89 50 04             	mov    %edx,0x4(%eax)
    bp->s.ptr = p->s.ptr->s.ptr;
 668:	8b 45 fc             	mov    -0x4(%ebp),%eax
 66b:	8b 00                	mov    (%eax),%eax
 66d:	8b 10                	mov    (%eax),%edx
 66f:	8b 45 f8             	mov    -0x8(%ebp),%eax
 672:	89 10                	mov    %edx,(%eax)
 674:	eb 0a                	jmp    680 <free+0x94>
  } else
    bp->s.ptr = p->s.ptr;
 676:	8b 45 fc             	mov    -0x4(%ebp),%eax
 679:	8b 10                	mov    (%eax),%edx
 67b:	8b 45 f8             	mov    -0x8(%ebp),%eax
 67e:	89 10                	mov    %edx,(%eax)
  if(p + p->s.size == bp){
 680:	8b 45 fc             	mov    -0x4(%ebp),%eax
 683:	8b 40 04             	mov    0x4(%eax),%eax
 686:	c1 e0 03             	shl    $0x3,%eax
 689:	03 45 fc             	add    -0x4(%ebp),%eax
 68c:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 68f:	75 20                	jne    6b1 <free+0xc5>
    p->s.size += bp->s.size;
 691:	8b 45 fc             	mov    -0x4(%ebp),%eax
 694:	8b 50 04             	mov    0x4(%eax),%edx
 697:	8b 45 f8             	mov    -0x8(%ebp),%eax
 69a:	8b 40 04             	mov    0x4(%eax),%eax
 69d:	01 c2                	add    %eax,%edx
 69f:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6a2:	89 50 04             	mov    %edx,0x4(%eax)
    p->s.ptr = bp->s.ptr;
 6a5:	8b 45 f8             	mov    -0x8(%ebp),%eax
 6a8:	8b 10                	mov    (%eax),%edx
 6aa:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6ad:	89 10                	mov    %edx,(%eax)
 6af:	eb 08                	jmp    6b9 <free+0xcd>
  } else
    p->s.ptr = bp;
 6b1:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6b4:	8b 55 f8             	mov    -0x8(%ebp),%edx
 6b7:	89 10                	mov    %edx,(%eax)
  freep = p;
 6b9:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6bc:	a3 30 08 00 00       	mov    %eax,0x830
}
 6c1:	c9                   	leave  
 6c2:	c3                   	ret    

000006c3 <morecore>:

static Header*
morecore(uint nu)
{
 6c3:	55                   	push   %ebp
 6c4:	89 e5                	mov    %esp,%ebp
 6c6:	83 ec 28             	sub    $0x28,%esp
  char *p;
  Header *hp;

  if(nu < 4096)
 6c9:	81 7d 08 ff 0f 00 00 	cmpl   $0xfff,0x8(%ebp)
 6d0:	77 07                	ja     6d9 <morecore+0x16>
    nu = 4096;
 6d2:	c7 45 08 00 10 00 00 	movl   $0x1000,0x8(%ebp)
  p = sbrk(nu * sizeof(Header));
 6d9:	8b 45 08             	mov    0x8(%ebp),%eax
 6dc:	c1 e0 03             	shl    $0x3,%eax
 6df:	89 04 24             	mov    %eax,(%esp)
 6e2:	e8 5d fc ff ff       	call   344 <sbrk>
 6e7:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(p == (char*)-1)
 6ea:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
 6ee:	75 07                	jne    6f7 <morecore+0x34>
    return 0;
 6f0:	b8 00 00 00 00       	mov    $0x0,%eax
 6f5:	eb 22                	jmp    719 <morecore+0x56>
  hp = (Header*)p;
 6f7:	8b 45 f4             	mov    -0xc(%ebp),%eax
 6fa:	89 45 f0             	mov    %eax,-0x10(%ebp)
  hp->s.size = nu;
 6fd:	8b 45 f0             	mov    -0x10(%ebp),%eax
 700:	8b 55 08             	mov    0x8(%ebp),%edx
 703:	89 50 04             	mov    %edx,0x4(%eax)
  free((void*)(hp + 1));
 706:	8b 45 f0             	mov    -0x10(%ebp),%eax
 709:	83 c0 08             	add    $0x8,%eax
 70c:	89 04 24             	mov    %eax,(%esp)
 70f:	e8 d8 fe ff ff       	call   5ec <free>
  return freep;
 714:	a1 30 08 00 00       	mov    0x830,%eax
}
 719:	c9                   	leave  
 71a:	c3                   	ret    

0000071b <malloc>:

void*
malloc(uint nbytes)
{
 71b:	55                   	push   %ebp
 71c:	89 e5                	mov    %esp,%ebp
 71e:	83 ec 28             	sub    $0x28,%esp
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
 721:	8b 45 08             	mov    0x8(%ebp),%eax
 724:	83 c0 07             	add    $0x7,%eax
 727:	c1 e8 03             	shr    $0x3,%eax
 72a:	83 c0 01             	add    $0x1,%eax
 72d:	89 45 ec             	mov    %eax,-0x14(%ebp)
  if((prevp = freep) == 0){
 730:	a1 30 08 00 00       	mov    0x830,%eax
 735:	89 45 f0             	mov    %eax,-0x10(%ebp)
 738:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 73c:	75 23                	jne    761 <malloc+0x46>
    base.s.ptr = freep = prevp = &base;
 73e:	c7 45 f0 28 08 00 00 	movl   $0x828,-0x10(%ebp)
 745:	8b 45 f0             	mov    -0x10(%ebp),%eax
 748:	a3 30 08 00 00       	mov    %eax,0x830
 74d:	a1 30 08 00 00       	mov    0x830,%eax
 752:	a3 28 08 00 00       	mov    %eax,0x828
    base.s.size = 0;
 757:	c7 05 2c 08 00 00 00 	movl   $0x0,0x82c
 75e:	00 00 00 
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 761:	8b 45 f0             	mov    -0x10(%ebp),%eax
 764:	8b 00                	mov    (%eax),%eax
 766:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if(p->s.size >= nunits){
 769:	8b 45 f4             	mov    -0xc(%ebp),%eax
 76c:	8b 40 04             	mov    0x4(%eax),%eax
 76f:	3b 45 ec             	cmp    -0x14(%ebp),%eax
 772:	72 4d                	jb     7c1 <malloc+0xa6>
      if(p->s.size == nunits)
 774:	8b 45 f4             	mov    -0xc(%ebp),%eax
 777:	8b 40 04             	mov    0x4(%eax),%eax
 77a:	3b 45 ec             	cmp    -0x14(%ebp),%eax
 77d:	75 0c                	jne    78b <malloc+0x70>
        prevp->s.ptr = p->s.ptr;
 77f:	8b 45 f4             	mov    -0xc(%ebp),%eax
 782:	8b 10                	mov    (%eax),%edx
 784:	8b 45 f0             	mov    -0x10(%ebp),%eax
 787:	89 10                	mov    %edx,(%eax)
 789:	eb 26                	jmp    7b1 <malloc+0x96>
      else {
        p->s.size -= nunits;
 78b:	8b 45 f4             	mov    -0xc(%ebp),%eax
 78e:	8b 40 04             	mov    0x4(%eax),%eax
 791:	89 c2                	mov    %eax,%edx
 793:	2b 55 ec             	sub    -0x14(%ebp),%edx
 796:	8b 45 f4             	mov    -0xc(%ebp),%eax
 799:	89 50 04             	mov    %edx,0x4(%eax)
        p += p->s.size;
 79c:	8b 45 f4             	mov    -0xc(%ebp),%eax
 79f:	8b 40 04             	mov    0x4(%eax),%eax
 7a2:	c1 e0 03             	shl    $0x3,%eax
 7a5:	01 45 f4             	add    %eax,-0xc(%ebp)
        p->s.size = nunits;
 7a8:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7ab:	8b 55 ec             	mov    -0x14(%ebp),%edx
 7ae:	89 50 04             	mov    %edx,0x4(%eax)
      }
      freep = prevp;
 7b1:	8b 45 f0             	mov    -0x10(%ebp),%eax
 7b4:	a3 30 08 00 00       	mov    %eax,0x830
      return (void*)(p + 1);
 7b9:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7bc:	83 c0 08             	add    $0x8,%eax
 7bf:	eb 38                	jmp    7f9 <malloc+0xde>
    }
    if(p == freep)
 7c1:	a1 30 08 00 00       	mov    0x830,%eax
 7c6:	39 45 f4             	cmp    %eax,-0xc(%ebp)
 7c9:	75 1b                	jne    7e6 <malloc+0xcb>
      if((p = morecore(nunits)) == 0)
 7cb:	8b 45 ec             	mov    -0x14(%ebp),%eax
 7ce:	89 04 24             	mov    %eax,(%esp)
 7d1:	e8 ed fe ff ff       	call   6c3 <morecore>
 7d6:	89 45 f4             	mov    %eax,-0xc(%ebp)
 7d9:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 7dd:	75 07                	jne    7e6 <malloc+0xcb>
        return 0;
 7df:	b8 00 00 00 00       	mov    $0x0,%eax
 7e4:	eb 13                	jmp    7f9 <malloc+0xde>
  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
  if((prevp = freep) == 0){
    base.s.ptr = freep = prevp = &base;
    base.s.size = 0;
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 7e6:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7e9:	89 45 f0             	mov    %eax,-0x10(%ebp)
 7ec:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7ef:	8b 00                	mov    (%eax),%eax
 7f1:	89 45 f4             	mov    %eax,-0xc(%ebp)
      return (void*)(p + 1);
    }
    if(p == freep)
      if((p = morecore(nunits)) == 0)
        return 0;
  }
 7f4:	e9 70 ff ff ff       	jmp    769 <malloc+0x4e>
}
 7f9:	c9                   	leave  
 7fa:	c3                   	ret    
